import request from '@/utils/request'
export default {
  data() {
    return {
      loading: false,
      visible: false,
      campusOptions: [],
      sourceOptions: [{ fullName: '订单', id: '1' }, { fullName: '赠送', id: '2' }],
      matheVersionOptions: [{ fullName: '人教', id: '1' }, { fullName: '冀教', id: '2' }, { fullName: '北师大', id: '3' }, { fullName: '青教', id: '4' }, { fullName: '苏教', id: '5' }],
      list: []
    }
  },
  mounted() {},
  methods: {
    getData(id) {
      let that = this
      that.list = []
      request({
        url: `/api/campus/account/${id}/list`,
        method: 'GET',
        data: {}
      }).then(res => {
        that.list = res.data
        that.loading = false
      })
    },
    init(id) {
      this.visible = true
      this.loading = true

      this.$nextTick(() => {
        this.getData(id)
      }, 100)
    }
  }
}
